<?php
	require_once("../api.php");
    session_start();
	$id = $_SESSION['user']['user_id'];
    if($_POST['mode'] != "keep-session"){
        unset($_SESSION['user']);
        session_destroy();
    }
	$db = new SQLite3("../chatroom.db");
	$sql ="update user set online = 0 where user_id = '$id'";
	$db->exec($sql);
	ajaxJSON(true,"success");
?>

